<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex flex-direction flex-wrap align-stretch benben-position-layout flex marketConsultation_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub marketConsultation_fd0_0'>
          <view class='flex flex-wrap align-center marketConsultation_fd0_0_c0' @tap.stop="handleJumpDiy"
            data-type="back" data-url="1">
            <text class='fu-iconfont2  marketConsultation_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='marketConsultation_fd0_0_c1_c0'>资讯详情</text>
          </view>
          <view class='flex  align-center justify-end marketConsultation_fd0_0_c0' style="width:150rpx;">
            <!--       <view class="flex flex-direction justify-center align-center margin-right-xs">
              <image class='marketConsultation_fd0_0_c2_c0_1' mode="aspectFit" :src='STATIC_URL+"188.png"'></image>
              <view class="text-xs text-333">分享</view>
            </view> -->

            <image class='marketConsultation_fd0_0_c2_c0' mode="aspectFit" :src='STATIC_URL+"7.png"'></image>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <view class="flex align-center justify-between upLoad" @click.stop="upLoad">
        <view class="flex align-center">
          <image class="logo" src="../../../static/logo.png" mode="aspectFill"></image>
          <view class="margin-left-sm">
            <view class="text-333 text-lg text-weight-600">惠找粮APP</view>
            <view class="text-666 text-df margin-top-xs">{{showObj.app_view}}</view>
          </view>
        </view>
        <view class="text-df text-white unipobtn">打开</view>
      </view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
        <view class='flex flex-direction flex-wrap align-stretch marketConsultation_fd1_0'>
          <view class='flex flex-wrap align-center'>
            <text class='marketConsultation_fd1_0_c0_c1'>
              <image class='marketConsultation_fd1_0_c0_c0' v-if="info.shifouVIP==1" mode="aspectFit"
                :src='STATIC_URL+"39.png"'></image>
              <image class='marketConsultation_fd1_0_c0_c0' v-if="info.shifouVIP==2" mode="aspectFit"
                :src='STATIC_URL+"191.png"'></image>{{info.mingcheng}}
            </text>
          </view>
          <view class='flex flex-wrap align-center justify-between marketConsultation_fd1_0_c1'>
            <view class='flex flex-wrap align-center'>
              <image class='marketConsultation_fd1_0_c1_c0_c0' mode="aspectFill" :src='info.touxiang'></image>
              <view class='flex flex-direction flex-wrap align-start'>
                <text class='marketConsultation_fd1_0_c1_c0_c1_c0'>{{info.faburen}}</text>
                <view class="text-sm text-999 margin-tb-xs">来自：{{laizi}}</view>
                <view class='flex flex-wrap align-center marketConsultation_fd1_0_c1_c0_c1_c1'>
                  <text class='marketConsultation_fd1_0_c1_c0_c1_c1_c0'>{{info.create_time}}</text>
                  <text class='marketConsultation_fd1_0_c1_c0_c1_c1_c1'>{{info.yueduliang}}</text>
                  <text class='marketConsultation_fd1_0_c1_c0_c1_c1_c1'>次阅读</text>
                </view>
              </view>
            </view>
            <view class='flex align-center ' style="margin-top: 30rpx;">
              <view class="flex align-center">
                <image class=' marketConsultation_fd0_0_c2_c0_1' mode="aspectFit" :src='STATIC_URL+"57.png"'>
                </image>
                <view class="text-df text-333 margin-right-sm">{{info.biaoqian}}</view>
              </view>
              <!-- <view class="flex align-center">
                <image @click.stop="popupShow1706715717630=true" class='marketConsultation_fd0_0_c2_c0_1'
                  mode="aspectFit" :src='STATIC_URL+"188.png"'>
                </image>
                <view @click.stop="popupShow1706715717630=true" class="text-df text-333">分享</view>
              </view> -->

            </view>
          </view>
        </view>
        <view class='flex flex-wrap align-center marketConsultation_fd1_1'>
          <jyf-parser class='marketConsultation_fd1_1_c0' :html="info.xiangqing">
          </jyf-parser>
        </view>
      </view>

      <!---flex布局flex布局结束-->


    </view>
    <!-- 分享  -->
    <benben-popup v-model="popupShow1706715717630" :mask="true" :mask-close-able="true" mode='bottom' :z-index='999'>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout releaseSale_flex_4">
        <view class='flex flex-direction flex-wrap align-stretch releaseSale_fd4_0'>
          <view class='flex flex-wrap align-center justify-between releaseSale_fd4_0_c0'>
            <view class='flex flex-wrap align-center releaseSale_fd4_0_c0_c0'>
            </view>
            <view class='flex flex-wrap align-center'>
              <image class='releaseSale_fd4_0_c0_c1_c0' mode="aspectFit" :src='STATIC_URL+"21.png"'></image>
              <text class='releaseSale_fd4_0_c0_c1_c1'>分享到</text>
              <image class='releaseSale_fd4_0_c0_c1_c0' mode="aspectFit" :src='STATIC_URL+"22.png"'></image>
            </view>
            <image class='releaseSale_fd4_0_c0_c2' mode="aspectFit" :src='STATIC_URL+"83.png"'
              @tap.stop="popupShow1706715717630=false"></image>
          </view>
          <view class='flex flex-wrap align-center justify-around releaseSale_fd4_0_c1'>
            <view class='flex flex-direction flex-wrap align-center' @click.stop="shareApp('1')">
              <image class='releaseSale_fd4_0_c1_c0_c0' mode="aspectFit" :src='STATIC_URL+"23.png"'></image>
              <text class='releaseSale_fd4_0_c1_c0_c1'>微信好友</text>
            </view>
            <view class='flex flex-direction flex-wrap align-center' @click.stop="shareApp('2')">
              <image class='releaseSale_fd4_0_c1_c0_c0' mode="aspectFit" :src='STATIC_URL+"84.png"'></image>
              <text class='releaseSale_fd4_0_c1_c0_c1'>朋友圈</text>
            </view>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->

    </benben-popup>
    <!-- enddd -->

  </view>
</template>
<script>
  export default {
    components: {},


    data() {
      return {
        laizi: '',
        "aid": "",
        info: '',
        popupShow1706715717630: false,
        links: '',
        showObj: ''
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      let {
        aid
      } = options
      if (aid !== undefined) this.aid = aid
      this.getData()
      this.$api.post(global.apiUrls.post64cdb895b79ba).then(res => {
        if (res.data.code == 1) {
          this.showObj = res.data.data
          this.links = res.data.data.android_download
        }
      })
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      upLoad() {
        let u = navigator.userAgent;
        var isWeixin = u.toLowerCase().indexOf('micromessenger') !== -1; // 微信内
        if (isWeixin) {
          this.$message.info('请在浏览器中打开')
          return false;
        }
        this.android()
        // window.location.href = this.links
      },
      android() {
        uni.showLoading({
          title: '加载中...'
        });
        const currentTime = new Date().getTime();
        window.location.href = "huizhaoliang://"; //找android工程师要 UrlSchemes
        // 启动间隔20ms运行的定时器，并检测累计消耗时间是否超过2000ms,超时则结束
        let _count = 0,
          timer;
        timer = setInterval(() => {
          _count++;
          const endTime = new Date().getTime() - currentTime;
          if (_count >= 200 || endTime > 5000) {
            uni.hideLoading()
            clearInterval(timer);
            let hidden = window.document.hidden || window.document.mozHidden || window.document
              .msHidden || window.document.webkitHidden;
            if (typeof hidden == "undefined" || hidden == false) {
              //App store下载地址
              window.location.href = this.links; //下载地址
            } else {
              window.location.href =
                `huizhaoliang://pages/market/marketConsultation/marketConsultation?aid=${this.aid} `
              window.close();
            }
          }
        }, 20)
      },
      shareApp(type) {
        let that = this
        let provider = ''
        let scene = ''
        if (type == 1) {
          provider = 'weixin'
          scene = 'WXSceneSession'
        } else if (type == 2) {
          provider = 'weixin'
          scene = 'WXSenceTimeline'
        }
        // let links = that.apartmentDetails.h5_share +
        //   `/pages/shouye/apartmentDetails/apartmentDetails?id=${that.apartmentDetails.aid}`
        // console.log(' that.apartmentDetails', links)
        uni.share({
          provider: provider,
          scene: scene,
          type: '0',
          // imageUrl: that.dataDetails.img,
          title: '惠找粮',
          href: that.info.h5_share,
          success: function(res) {
            console.log('22222')
            console.log("success:" + JSON.stringify(res));
          },
          fail: function(err) {
            console.log("fail:" + JSON.stringify(err));
          }
        });
      },
      getData() {
        this.$api.post(global.apiUrls.post64cdb895b79ba, {
          aid: this.aid
        }).then(res => {
          if (res.data.code == 1) {
            this.laizi = res.data.data.new_source
          }
        })
        this.$api.post(global.apiUrls.post65d43b97b5a93, {
          aid: this.aid
        }).then(res => {
          if (res.data.code == 1) {
            this.info = res.data.data
          }
        })
      }
    }
  };
</script>
<style lang="scss" scoped>
  .upLoad {
    padding: 24rpx;
    background-color: rgba(37, 104, 174, 0.3);

    .logo {
      width: 100rpx;
      height: 100rpx;
      border-radius: 16rpx;
    }

    .unipobtn {
      background-color: rgba(37, 104, 174, 1);
      width: 110rpx;
      height: 50rpx;
      line-height: 50rpx;
      border-radius: 33rpx;
      text-align: center;
    }
  }

  .releaseSale_flex_4 {
    background: rgba(255, 255, 255, 1);
    border-radius: 40rpx 40rpx 0rpx 0rpx;
    background-size: 100% auto;
  }

  .releaseSale_fd4_0_c1_c0_c1 {
    color: #333333;
    margin: 16rpx 0rpx 0rpx 0rpx;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 46rpx;
  }

  .releaseSale_fd4_0_c1_c0_c0 {
    width: 80rpx;
    height: 80rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd4_0_c1 {
    margin: 50rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd4_0_c0_c2 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd4_0_c0_c1_c1 {
    margin: 0rpx 20rpx 0rpx 20rpx;
    color: #333333;
    font-size: 32rpx;
    font-weight: 400;
    line-height: 46rpx;
  }

  .releaseSale_fd4_0_c0_c1_c0 {
    width: 28rpx;
    height: 10rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd4_0_c0_c0 {
    width: 40rpx;
    height: 40rpx;
  }

  .releaseSale_fd4_0_c0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .releaseSale_fd4_0 {
    padding: 40rpx 0rpx 56rpx 0rpx;
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(255, 255, 255, 1);
    background-size: 100% auto;
  }

  .marketConsultation_flex_0 {
    background: rgba(255, 255, 255, 1);
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto;
  }

  .marketConsultation_fd0_0_c2_c0 {
    width: 119rpx;
    height: 55rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .marketConsultation_fd0_0_c2_c0_1 {
    width: 32rpx;
    height: 32rpx;
    margin-right: 12rpx;
    display: block;

  }

  .marketConsultation_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .marketConsultation_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .marketConsultation_fd0_0_c0 {
    width: 120rpx;
  }

  .marketConsultation_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  ::v-deep .marketConsultation_fd1_1_c0 {
    width: 100%;
  }

  .marketConsultation_fd1_1 {
    margin: 40rpx 30rpx 0rpx 30rpx;
  }

  .marketConsultation_fd1_0_c1_c1_c1 {
    color: #EC161A;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 48rpx;
  }

  .marketConsultation_fd1_0_c1_c1_c0 {
    width: 24rpx;
    height: 30rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    // margin: 0rpx 10rpx 0rpx 0rpx;
  }

  .marketConsultation_fd1_0_c1_c0_c1_c1_c1 {
    color: #ACACAC;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 48rpx;
  }

  .marketConsultation_fd1_0_c1_c0_c1_c1_c0 {
    color: #ACACAC;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 48rpx;
    margin: 0rpx 16rpx 0rpx 0rpx;
  }

  .marketConsultation_fd1_0_c1_c0_c1_c1 {
    // margin: 10rpx 0rpx 0rpx 0rpx;
  }

  .marketConsultation_fd1_0_c1_c0_c1_c0 {
    color: #101010;
    font-size: 28rpx;
    font-weight: 700;
    line-height: 32rpx;
  }

  .marketConsultation_fd1_0_c1_c0_c0 {
    width: 80rpx;
    height: 80rpx;
    border-radius: 100rpx;
    margin: -10px 24rpx 0rpx 0rpx;
  }

  .marketConsultation_fd1_0_c1 {
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .marketConsultation_fd1_0_c0_c1 {
    color: #101010;
    font-size: 40rpx;
    font-weight: 700;
    line-height: 56rpx;
  }

  .marketConsultation_fd1_0_c0_c0 {
    width: 60rpx;
    height: 30rpx;
    margin: 0rpx 16rpx 0rpx 0rpx;
  }

  .marketConsultation_fd1_0 {
    margin: 22rpx 24rpx 0rpx 24rpx;
  }
</style>
